package com.autonavi.yunda.yunji.core.service;

import com.taobao.tair.DataEntry;
import com.taobao.tair.ResultCode;

import java.util.List;
import java.util.Map;

/**
 * @author cizhong.wcs
 * @date 2023/8/3 10:40
 */
public interface ICommonTairService {
    ResultCode put(String dbName, String key, String value, int version, int expired);

    String get(String dbName, String key);

    boolean invalid(String dbName, String key);

    /**
     * 批量get
     */
    List<DataEntry> mget(String dbName, List<String> key);

    /**
     * 异常返回-1
     */
    Map<String, Integer> mgetInt(String dbName, List<String> key);

    int incTime(String dbName, String key, Integer expireTime);

    /**
     * 多线程分批 批量get
     */
    List<DataEntry> tairBatchGet(String dbName, List<String> keys, int groupSize);
}
